#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int N = 15;
int n;
int st[N];

void dfs(int m)
{
    if (m > n)
    {
        for (int i = 1; i <= n; ++i)
            if (st[i] == 1)
                printf("%d ", i);
        puts("");  //printf("\n");
        return;
    }

    dfs(m + 1);

    st[m] = 1;
    dfs(m + 1);
    st[m] = 0;
}

int main()
{
    cin >> n;

    dfs(1);

    return 0;
}